package com.dk.post.controller;

import com.dk.post.dto.UpvoteDTO;
import com.dk.post.service.impl.UpvoteServiceImpl;
import com.ts.common.core.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class UpvoteController {

    @Autowired
    private UpvoteServiceImpl upvoteService;

    @PostMapping("/upvote")
    public Result Upvote(@RequestBody UpvoteDTO dto){

        //1.判断用户是否登录


        //2.拿到uid
//        dto.setUid(1);
        log.info("dto:{}",dto);

        //3.调用业务层实现点赞
        upvoteService.add(dto);
        return new Result();
    }
}
